<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>jsonp</title>
</head>
<body>
    
    <button id="btn">click</button>
    <textarea name="" id="text" cols="30" rows="10"></textarea>

    <script>

    function callback (data) {
        var result = JSON.stringify(data);
        var text = document.getElementById('text');
        text.value = result;
    }    
    
    function jsonp (url,callback) {
        var script = document.createElement('script');
        var _url = url + '?cb='+ callback;
        script.src = _url;
        document.body.appendChild(script);
    }

    jsonp('https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su','callback');
    
    </script>

</body>
</html>